﻿<%@ Page Title="" Language="C#" MasterPageFile="~/uc/MemberIndex.Master" AutoEventWireup="true" CodeBehind="shop_product.aspx.cs" Inherits="ncp.Web.member.shop_product" %>
<asp:Content ID="Content1" ContentPlaceHolderID="header" runat="server">
<title>产品展示-中国农业信息化服务商</title>

    <script src="/js/paging.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <div style="background:#77a400;">
        <div class="bh-con-right-h-yy-control"><a href="#" onclick="pruductLimit()">添加产品</a></div>
        <div class="bh-con-right-h-yy"><a href="#">店铺管理</a> > 产品展示</div>
    </div>

<ul class="listTitle">
<li class="title">标题</li>
<li class="click"></li>
<li class="datetime">发布时间</li>
<li class="audit">审核</li>
<li class="operate">操作</li>
</ul>
<div class="bh-zzg-ny-cleftbr" style="width: 785px;">
    
        <div class="bh-zzg-ny-cleftbrt newslist">
      </div>
      <div id="paging" class="bh-zzg-ny-cleftbrbottom">

    </div>
</div>
      <script type="text/javascript">
      	var sorting = "Product_StartTime";
      	$("ul.sorting-btns a").click(function() {
      		$("ul.sorting-btns a").removeClass("crt");
      		$(this).addClass("crt");
      		sorting = $(this).attr("sort");
      		paging.query();
    });
    var paging;
    $(function() {
        paging = new Paging();
        paging.dataCount = 0;
        var response = ncp.Web.member.shop_product.GetProductCount();
        if (response.value != null) {
            var jsonOBJ = eval(response.value)[0];
            if (jsonOBJ.isreload) {
                paging.dataCount = jsonOBJ.msg;
            }
        }
        paging.loadPagingText();
        paging.query();
    });
    Paging.prototype.query = function() {
      		var rep = ncp.Web.member.shop_product.GetProductList(paging.pageIndex-1, paging.pageSize, sorting);
      		if (rep.value != null) {
      			var json = eval(rep.value)[0];
      			if (json.isreload) {
      			    $(".newslist").html(json.msg);
      			}
      		}
    }
      	function pruductLimit() {
      	    var rep = ncp.Web.member.shop_product.GetProductLimit();
      	    if (rep.value != null) {
      	        var json = eval(rep.value)[0];
      	        if (json.isreload) {
      	            location.href = "/member/product_add.html";
      	        }
      	        else {
      	            alert(json.msg);
      	        }
      	    }
      	}
      	function onDelete(id) {
      	    if (confirm("确定要删除这条记录吗？删除后将无法恢复！")) {
      	        var rep = ncp.Web.member.shop_product.Delete(id);
      	        if (rep.value != null) {
      	            var jsonOBJ = eval(rep.value)[0];
      	            alert(jsonOBJ.msg);
      	            if (jsonOBJ.isreload) {
      	                var response = ncp.Web.member.shop_product.GetProductCount();
      	                if (response.value != null) {
      	                    jsonOBJ = eval(response.value)[0];
      	                    if (jsonOBJ.isreload) {
      	                        paging.dataCount = jsonOBJ.msg;
      	                    }
      	                }
      	                paging.loadPagingText();
      	                paging.query();
      	            }
      	        }
      	    }
      	}
      	$(function() {
      		paging.query();
      	});
      </script>
</asp:Content>
